fix: filter docker compose hook rewrites to supported subcommands#245
Open
mercierj wants to merge 1 commit intortk-ai:masterfrom
Open
fix: filter docker compose hook rewrites to supported subcommands#245mercierj wants to merge 1 commit intortk-ai:masterfrom
mercierj wants to merge 1 commit intortk-ai:masterfrom
Conversation
The hook was rewriting all `docker compose` commands to `rtk docker compose`, but rtk only supports ps, logs, and build. Unsupported subcommands (up, down, exec, restart...) and compose-level flags (-f, --project-name) caused hard failures. Now matches the approach used by the regular docker branch: only rewrite when the subcommand is known to be supported. Fixes rtk-ai#244 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #244
The hook was rewriting all
docker composecommands tortk docker compose, but rtk only supportsps,logs, andbuildas compose subcommands. Everything else (up,down,exec,restart...) and compose-level flags (-f,--project-name,--env-file) caused failures like:This PR applies the same filtering approach already used by the regular
dockerbranch: only rewrite when the subcommand is known to be supported.Changes
rtk-rewrite.sh: Extract compose subcommand and match againstps|logs|buildbefore rewritingtest-rtk-rewrite.sh: Updated compose tests to expect passthrough for unsupported subcommands, added coverage forps,build,-fflag, and env var prefix with supported/unsupported subcommandsTest results
All docker compose tests pass. The 9 pre-existing failures (find, tree, wget, audit) are unrelated.